// 全局日志中间件
const morgan = require('morgan');
const logger = require('./logger');

function logMiddleware(app) {
    app.use(morgan('combined', { stream: { write: message => logger.info(message.trim()) } }));
}

module.exports = logMiddleware;